import threading
import time




# 创建类 继承线程父类
class MyThread(threading.Thread):

    def run(self): # 重写任务函数 run函数
        for i in range(1,11):
            print(self.name,i)

if __name__ == '__main__':
   # 创建线程对象
    thread1 = MyThread()
    thread2 = MyThread()
   # 启动线程
    thread1.start()
    thread2.start()



